****Replication Files***

***************************************************************
***************************************************************
******European Journal of Political Research*******************
******Cabinet Ministers and Inequality*************************
**********Despina Alexiadou************************************
******Analysis conducted using STATA/SE 15.1*******************
***************************************************************
***************************************************************
***************************************************************

**********************************
*****Coding of professions of cabinet ministers*****
**********************************

use "/ministers_alexiadou_ejpr.dta"

gen economists=0
replace economists=1 if priorprofcat1==1 | priorprofcat2==1 | priorprofcat3==1
gen banker=0
replace banker=1 if priorprofcat1==2 |priorprofcat2==2 |priorprofcat3==2 
gen executive=0
replace executive=1 if priorprofcat1==3 |priorprofcat2==3| priorprofcat3==3
gen businessman=0
replace businessman=1 if priorprofcat1==4 |priorprofcat2==4| priorprofcat3==4
gen econbusiness=0
replace econbusiness=1 if economists==1 | banker==1| executive==1 | businessman==1
gen selfemployed=0
replace selfemployed=1 if priorprofcat1==5 |priorprofcat2==5 |priorprofcat3==5
gen salary=0
replace salary=1 if priorprofcat1==6 |priorprofcat2==6 |priorprofcat3==6
gen consultant=0
replace consultant=1 if  priorprofcat1==7 |priorprofcat2==7| priorprofcat2==7
gen lawyer=0
replace lawyer=1 if priorprofcat1==8 |priorprofcat2==8| priorprofcat3==8
gen advisor=0
replace advisor=1 if priorprofcat1==9 | priorprofcat2==9 | priorprofcat3==9
gen doctor=0
replace doctor=1 if priorprofcat1==10 |priorprofcat2==10 |priorprofcat3==10
gen engineer=0
replace engineer=1 if priorprofcat1==11 | priorprofcat2==11 |priorprofcat3==11
gen scientist=0
replace scientist=1 if priorprofcat1==12 |priorprofcat2==12 |priorprofcat3==12
gen humanities=0
replace humanities=1 if priorprofcat1==13 | priorprofcat2==13| priorprofcat3==13
gen civilservice=0
replace civilservice=1 if priorprofcat1==17 |priorprofcat2==17 |priorprofcat3==17
gen prof=0
replace prof=1 if  priorprofcat1==14  |priorprofcat2==14  |priorprofcat3==14
gen journalist=0
replace journalist=1 if priorprofcat1==15 |priorprofcat2==15| priorprofcat3==15
gen military=0
replace military=1 if priorprofcat1==16 |priorprofcat2==16 |priorprofcat3==16
gen tradeunionist=0
replace tradeunionist=1 if priorprofcat1==20 |priorprofcat2==20 |priorprofcat3==20
gen bluecollar=0
replace bluecollar=1 if priorprofcat1==18 |priorprofcat2==18 |priorprofcat3==18
gen offpolitics=0
replace offpolitics=1 if priorprofcat1==19 | priorprofcat2==19| priorprofcat3==19
gen employers=0
replace employers=1 if priorprofcat1==21 | priorprofcat2==21 |priorprofcat3==21
gen interests=0
replace interests=1 if priorprofcat1==22 |priorprofcat2==22 |priorprofcat3==22
gen localpolitics=0
replace localpolitics=1 if priorprofcat1==23 |priorprofcat2==23 | priorprofcat3==23
gen mep=0
replace mep=1 if priorprofcat1==24 | priorprofcat2==24 | priorprofcat3==24
gen gos=0
replace gos=1 if priorprofcat1==25 | priorprofcat2==25 |priorprofcat3==25
gen charities=0
replace charities=1 if priorprofcat1==26 |priorprofcat2==26 |priorprofcat3==26
gen socialprof=0
replace socialprof=1 if humanities==1  | charities==1
gen profpolitician=0
replace profpolitician=1 if offpolitics==1 | localpolitics==1 | mep==1
gen homopoliticus=0
replace homopoliticus=1 if profpolitician==1 | lawyer==1


label define priorprofcat1 1 "Economist"
label define priorprofcat1 2 "Finance/Banking", add
label define priorprofcat1 3 "Executive", add
label define priorprofcat1 4 "Businessman", add
label define priorprofcat1 5 "Self Employed", add
label define priorprofcat1 6 "Salaried Employee", add
label define priorprofcat1 7 "Consultant", add
label define priorprofcat1 8 "Lawyer", add
label define priorprofcat1 9 "Policy Advisor", add
label define priorprofcat1 10 "Medical Doctor", add
label define priorprofcat1 11 "Engineer", add
label define priorprofcat1 12 "Scientist", add
label define priorprofcat1 13 "Humanities", add
label define priorprofcat1 14 "Professor", add
label define priorprofcat1 15 "Journalist", add
label define priorprofcat1 16 "Military", add
label define priorprofcat1 17 "Civil Servant", add
label define priorprofcat1 18 "Blue Collar", add
label define priorprofcat1 19 "Living Off Politics", add
label define priorprofcat1 20 "Full Time Trade Union", add
label define priorprofcat1 21 "Full Time Employers' Organization", add
label define priorprofcat1 22 "Full Time Interest Group", add
label define priorprofcat1 23 "Local Politics", add
label define priorprofcat1 24 "European Parliament",add
label define priorprofcat1 25 "Suprantional Institution" ,add
label define priorprofcat1 26 "Non-for profit",add
label define priorprofcat1 27 "Unemployed",add
label define priorprofcat1 28 "Other",add
label define priorprofcat1 29 "Unknown",add
label values priorprofcat1 priorprofcat1 


********************************************************
***Coding social class of cabinet ministers*************
*********************************************************

gen socio_prof= humanities==1 | prof==1 | journalist==1
gen socio_prof1= priorprofcat1==13 | priorprofcat1==14 | priorprofcat1==15

gen technical_prof= economist==1 | consultant==1 | engineer==1 | scientist==1 | doctor==1 | advisor==1
gen technical_prof1= priorprofcat1==1 | priorprofcat1==7 | priorprofcat1==11 | priorprofcat1==12 | priorprofcat1==9 | priorprofcat1==10

gen civil1= priorprofcat1==17

gen liberal_prof= banker==1 | executive==1 | lawyer==1
gen liberal_prof1= priorprofcat1==2 | priorprofcat1==3 | priorprofcat1==8

gen owning_class= business==1 | selfemployed==1
gen owning_class1= priorprofcat1==4 | priorprofcat1==5
 
gen working_class= bluecollar==1 | salary==1 | tradeunionist==1
gen working_class1= priorprofcat1==6 | priorprofcat1==20 | priorprofcat1==18



***************************************************************
***************************************************************
****Descriptives***********************************************
***************************************************************
***************************************************************

***********************
*****Figure 2******
***********************

use "/ministers_alexiadou_ejpr.dta"

graph hbar, over(priorprofcat1, sort(1) descending axis(off)) blabel(group) ///
			 scheme(s2mono) ///
             graphregion(fcolor(white)) ///                    
			 ytitle("Percent") ///
			 title("1945-2015", size(3.5)) ///
             ylabel(0 (5) 20)
graph save prior_prof_1945_2015.gph, replace	
		 
graph hbar if govyear>1999, over(priorprofcat1, sort(1) descending axis(off)) blabel(group) ///
			 scheme(s2mono) ///
             graphregion(fcolor(white)) ///                    
			 ytitle("Percent") ///
			 title("2000-2015", size(3.5)) ///
             ylabel(0 (5) 20) 
graph save prior_prof_2000_2015.gph, replace

graph combine prior_prof_1945_2015.gph prior_prof_2000_2015.gph,  ///
             title("Primary Professional Experience Prior to Entering Politics", size(medsmall)) col(2) ///
             graphregion(fcolor(white))	
graph save prior_prof_breakR1.gph, replace
graph export prior_prof_breakR1.pdf, replace

***********************
*****Figure 1******
***********************
use "ESS1-8e01_ejpr.dta"

graph bar (mean) gap_socio_work gap_lib_work gap_lib_socio, ///
            scheme(s2mono) ///
            graphregion(fcolor(white)) ///
			title("Gap in Redistributional Preferences Between Classes", size(3.5)) ///
			subtitle("ESS data, Waves 1-8, 2002-2016", size(3)) ///
			ylabel(0(.05).15) ///
			legend( label(1 "Working Class minus Sociocultural Professionals") label(2 "Working Class minus Liberal Professionals") label(3 "Sociocultural minus Liberal Professionals")) ///
			legend(r(3))
graph save ess_gap_preference.gph, replace
graph export ess_gap_preference.pdf, replace


***********************
*****Figure 3******
***********************
use "ESS1-8e01_ejpr.dta"

***Graph 1**************
graph hbar liberal_prof_ess owning_class socio_prof_ess technical_prof_ess  managerial_prof_ess working_class, percent ///
            scheme(s2mono) ///
            graphregion(fcolor(white)) ///
			title("Distribution of Classes: ESS Survey Data", size(3.5)) ///
			subtitle("15 European Countries, Waves 1-8, 2002-2016", size(3)) ///
			legend(label(1 "Liberal Professionals & Executives") label(2 "Owning Class") label(3 "Sociocultural Professionals")  label(4 "Technical") label(5 "Managerial") label(6 "Working Class") ) ///
			legend(r(3))
graph save ess_class.gph, replace
graph export ess_class.pdf, replace

***************************
******Graph 2*************
use "/ministers_alexiadou_ejpr.dta"

graph hbar liberal_prof1 owning_class1 socio_prof1 technical_prof1 civil1 working_class1 if govyear>1969 ,over(left) stack ///
            scheme(s2mono) ///
            graphregion(fcolor(white)) ///
			title("Distribution of Ministerial Classes by Partisan Ideology", size(3.5)) ///
			subtitle("18 Countries, 1970-2015", size(3)) ///
			legend(label(1 "Liberal Professionals") label(2 "Owning Class") label(3 "Socio-cultural") label(4 "Technical") label(5 "Managerial") label(6 "Working Class")) ///
			legend(r(3))
graph save ministers_class_party.gph, replace
graph export ministers_class_party.pdf, replace


***************************************************************
***************************************************************
***Analysis***********************************************
***************************************************************
***************************************************************



***********************
****Table 1*********
***********************

***Table 1***
use "SBH_P&S_Data_Despina_ejpr.dta"

xtmixed dgentav14 gent loggdpt growtht leftgov p10 meanworking_class meansocio_prof i.topic || country:, vce(rob)
est sto t1a
xtmixed dgentav14 gent loggdpt growtht leftgov p10 meanliberal_prof i.topic || country:, vce(rob)
est sto t1b 
xtmixed dgentav14 gent loggdpt growtht leftgov c.p10 c.meansocio_prof c.meansocio_prof#c.p10 i.topic  || country:, vce(rob)
est sto t1c 
xtmixed dgentav14 gent loggdpt growtht leftgov c.p10 c.meanworking_class c.meanworking_class#c.p10 i.topic  || country:, vce(rob)
est sto t1d   
xtmixed dgentav14 gent loggdpt growtht leftgov c.p10 c.meanliberal_prof c.meanliberal_prof#c.p10 i.topic  || country:, vce(rob)
est sto t1e   
xtmixed dgentav14 gent loggdpt growtht leftgov c.p90 c.meansocio_prof c.meansocio_prof#c.p90 i.topic  || country:, vce(rob)
est sto t1f 


esttab t1a  t1b  t1c  t1d t1e  t1f  using table1_ejpr.csv, se ///
star(* 0.10 ** 0.05 *** 0.01) collabels(none) ///
stats (N_g N) ///
noabbrev numbers lines parentheses nogap replace fragment

keep 

************************************ 
*********Figure 4*******************
************************************ 
  ***policy impact of socio-professionals as intensity of p10 preferences varies***

xtmixed dgentav14 gent loggdpt growtht leftgov p10 meansocio_prof sociop10 i.topic  || country:, vce(rob) 

egen minMVlist = min(meansocio_prof) 
scalar minMV=minMVlist[1]
drop minMVlist

egen maxMVlist = max(meansocio_prof)
scalar maxMV=maxMVlist[1]
drop maxMVlist

generate MV=  minMV+ ((_n-1)*((maxMV-minMV)/_N))


matrix B=e(b) 
matrix V=e(V)

 
scalar i1 = colnumb(B,"p10")
scalar i2 = colnumb(B,"meansocio_prof")
scalar i3 = colnumb(B,"sociop10")
 
scalar b1=B[1,i1] 
scalar b2=B[1,i2]
scalar b3=B[1,i3]

scalar varb1=V[i1,i1] 
scalar varb2=V[i2,i2] 
scalar varb3=V[i3,i3]

scalar covb1b3=V[i1,i3] 
scalar covb2b3=V[i2,i3]

scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3

gen conb=b1+b3*MV

gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV)


*generate upper and lower bounds of the confidence interval
*specify the confidence interval

gen a=1.96*conse
gen upper=conb+a
gen lower=conb-a
**************************************************************
hist meansocio_prof
gen zerol=0            
  # delimit;
graph twoway hist meansocio_prof, yscale(alt range(`=r(max)')) fcolor(gs15) lwidth(vvthin)
		  || line conb MV, clpattern(solid) clwidth(thin) yaxis(2) yscale(alt axis(2)) 
          || line upper MV, clpattern(solid) clwidth(thin) yaxis(2) yscale(alt axis(2))
          || line lower MV, clpattern(solid) clwidth(thin) yaxis(2) yscale(alt axis(2))
		  || line zerol MV,  lcolor(black) yaxis(2)
		  ||,
             xscale(noline)
             yscale(noline)
             legend(off)
             title("Effect of preferences of bottom 10% on welfare generosity as number of sociocultural ministers varies", size(2.5))
             subtitle("Dependent variable: Change in Welfare Generosity", size(2.5))
             xtitle("Socio-cultural Ministers", size(2.5))
             ytitle(" ", size (2.5) axis(2))
			 ytitle("Density", size(2.5) axis(1))
			 ylabel(0 (0.05) 0.15, axis(2))
			 note("Confidence intervals at the 95% level", size(2))
             xsca(titlegap(2))
             ysca(titlegap(4))
             scheme(s2mono)
             graphregion(fcolor(white))
             graphregion(margin(r=28));
 # delimit cr            exit; 

graph save Graph_ResponseP10.gph, replace
graph export Graph_ResponseP10.pdf, replace 


 drop lower upper a conse conb MV zerol
 
********
*********
 
****table2*******
xtmixed dgentav14 gent loggdpt growtht p10 c.leftgov c.meansocio_prof c.meansocio_prof#c.leftgov i.topic  || country:, vce(rob)
est sto t2a
xtmixed dgentav14 gent loggdpt growtht p10 c.leftgov c.meanworking_class c.meanworking_class#c.leftgov i.topic  || country:, vce(rob)
est sto t2b 
xtmixed dgentav14 gent loggdpt growtht p10 c.leftgov c.meanliberal_prof c.meanliberal_prof#c.leftgov i.topic  || country:, vce(rob)
est sto t2c

esttab t2a  t2b  t2c  using table2_ejpr.csv, se ///
star(* 0.10 ** 0.05 *** 0.01) collabels(none) ///
stats (N_g N) ///
noabbrev numbers lines parentheses nogap replace fragment


************************************ 
*********Figure 5*******************
*********Figure 5********************
************************************ 
*****
xtmixed dgentav14 gent loggdpt growtht p10 c.leftgov##c.meanworking_class  i.topic || country:, vce(rob)
margins,  dydx(meanworking_class) at(leftgov=(0(20)100)) vsquish level(90)
marginsplot, recast(line) recastci(rarea) yline(0) ///
			 scheme(s2mono) ///
             graphregion(fcolor(white)) ///                  
			 title("Working class ministers' effect on generosity conditional on left cabinet seats", size(3.5)) ///
			 ytitle("Marginal Effect on Welfare Generosity") ///
			 xtitle("Left-wing parties as percent of cabinet seats") ///
			 note("Confidence intervals at the 90% level", size(2))
graph save work_leftgov_10.gph, replace	
graph export work_leftgov_10.pdf, replace	

****
************************************ 
*********Figure 6*******************
*********Figure 6********************
************************************ 

xtmixed dgentav14 gent loggdpt growtht p10 c.leftgov##c.meansocio_prof  i.topic || country:, vce(rob)
margins,  dydx(meansocio_prof) at(leftgov=(0(20)100)) vsquish level(90)
marginsplot, recast(line) recastci(rarea) yline(0) ///
			 scheme(s2mono) ///
             graphregion(fcolor(white)) ///                  
			 title("Sociocultural prof. ministers' effect on generosity conditional on left cabinet seats", size(3.5)) ///
			 ytitle("Marginal Effect on Welfare Generosity") ///
			 xtitle("Left-wing parties as percent of cabinet seats") ///
			 note("Confidence intervals at the 90% level", size(2))
graph save sc_leftgov_10.gph, replace	
graph export sc_leftgov_10.pdf, replace


****************
****Table 3***
***************
use "ministers_qog_ejpr.dta"

xtreg dtotgen totgen1 l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg gov_left1_1 meanworking_class_1 meansocio_prof_1, fe robust 
est sto t3a
xtreg dtotgen totgen1 l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg  gov_left1_1 meanliberal_prof_1, fe robust
est sto t3b
xtreg duegen uegen1 l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg  gov_left1_1 meanworking_class_1 meansocio_prof_1, fe robust 
est sto t3c
xtreg duegen uegen1  l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg  gov_left1_1 meanliberal_prof_1, fe robust
est sto t3d
xtreg d.sc_ue l.sc_ue l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg  gov_left1_1 meanworking_class_1 meansocio_prof_1, fe robust 
est sto t3e
xtreg d.sc_ue l.sc_ue l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg  gov_left1_1 meanliberal_prof_1, fe robust 
est sto t3f

esttab t3a  t3b  t3c  t3d t3e  t3f  using table3_ejpr.csv, se ///
star(* 0.10 ** 0.05 *** 0.01) collabels(none) ///
stats (N_g N) ///
noabbrev numbers lines parentheses nogap replace fragment


***************
****Table 4***
***************

use "/soroka_uk_ministers_ejpr.dta"

keep year counter govt1 govt2 govt3 govt4 gdp debt unemp inflation expectations numposall numnegall pmrile meanbluecollar meansocio_prof meanworking_class meanliberal_prof 

nbreg numposall pmrile meanworking_class  meansocio_prof,robust irr
est sto t4a
nbreg numposall pmrile meanliberal_prof,robust irr
est sto t4b

esttab t4a  t4b using table4.csv, se ///
star(* 0.10 ** 0.05 *** 0.01) collabels(none) ///
stats (N_g N) ///
noabbrev numbers lines parentheses replace fragment

*********************
*****table 5*********
*********************
use "ministers_qog_ejpr.dta"

xtreg duegen uegen1 l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg meanworking_class_1 i.leftsaffairs_1##c.meansocio_prof_1, fe robust 
est sto t5a 
xtreg duegen uegen1 l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg meanworking_class_1 c.gov_left1_1##c.meansocio_prof_1, fe robust 
est sto t5b 
xtreg duegen uegen1 l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg meansocio_prof_1 i.leftsaffairs_1##c.meanworking_class_1, fe robust 
est sto t5c 
xtreg duegen uegen1 l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg meansocio_prof_1 c.gov_left1_1##c.meanworking_class_1, fe robust 
est sto t5d 
xtreg duegen uegen1 l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg  i.leftsaffairs_1##c.meanliberal_prof_1,fe robust 
est sto t5e 
xtreg duegen uegen1 l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg  c.gov_left1_1##c.meanliberal_prof_1 , fe robust 
est sto t5f  

esttab t5a  t5b  t5c  t5d t5e  t5f  using table5_ejpr.csv, se ///
star(* 0.10 ** 0.05 *** 0.01) collabels(none) ///
stats (N_g N) ///
noabbrev numbers lines parentheses nogap replace fragment


******************************
****Figure 7******
**********************************
*****Unemployment benefits social welfare minister**
xtreg duegen uegen1 l.imf_ue l.imf_gdpgr l.log_gle_rgdpc l.dr_eg l.meansocio_prof i.leftsaffairs_1##c.meanworking_class_1 , fe robust
margins leftsaffairs_1, at(meanworking_class_1=(0(0.2)1)) vsquish level(95) 
marginsplot, recast(connected) recastci(rarea) yline(0)  ///
			 scheme(s2mono) ///
             graphregion(fcolor(white)) ///                  
			 title("Left Social Welfare & Working Class Ministers ", size(3.5)) ///
			 xtitle("Percent of Working Class Ministers in Cabinet") ///
			 ytitle(" ") ///
			 legend(ring(0) order(1 "Right S. Affairs" 2 "Left S. Affairs" )) ///
			 name(fig7, replace) 
graph export fig7.pdf, replace
**********************
